import Vue from 'vue';
import { Dialog } from 'vant';
import router from '@/router/router';

Vue.use(Dialog);

export function errorDialog(msg){
  Dialog.confirm({
    message: msg,
    messageAlign:'left',
    cancelButtonColor:"#333",
    confirmButtonText:"去注册",
    confirmButtonColor:"#FF9900",
    closeOnClickOverlay:true,
    className:"default_dialog"
  }).then(() => {
    router.push({ path:'/registered' })
  });
}

export function errorDialogs(msg){
  Dialog.confirm({
    message: msg,
    messageAlign:'left',
    cancelButtonColor:"#333",
    confirmButtonText:"去登录",
    confirmButtonColor:"#FF9900",
    closeOnClickOverlay:true,
    className:"default_dialog"
  }).then(() => {
    router.push({ path:'/login' })
  });
}